<?php if (isset($_GET['id_pager'])):?>
	<?php $data = $this->getPager($_GET['id_pager']);?>
<?php else:?>
	<?php $data = $this->getRequest()->getPost()?>
<?php endif;?>
<?php $topics = $this->getTopics ();?>

<div class="grid_10">
	<div class="box round first fullpage">
		<h2>Add pager</h2>
		<div class="block ">
			<form action="<?php echo Epic::getUrl('admin/journal/addPager',array('id_journal'=>$_GET['id_journal']))?>" method="post" enctype="application/x-www-form-urlencoded">
			
			<table class="form">
				<tbody>
				<tr>
					<td>
						<label>	Name Pager</label>
					</td>
					<td>
						<input type="hidden" class="" name="id_journal" value="<?php echo $_GET['id_journal']?>">
						<?php if (isset($_GET['id_pager'])):?>
							<input type="hidden" class="" name="id_pager" value="<?php echo $_GET['id_pager']?>">
						<?php endif;?>
						<input type="text" class="large" name="name" value="<?php if (isSet($data['name'])) echo $data['name']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Doi
							</label>
					</td>
					<td>
						<input type="text" class="grumble" name="doi" value="<?php if (isSet($data['doi'])) echo $data['doi']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Volume
							</label>
					</td>
					<td>
						<input type="text" class="grumble" name="volume" value="<?php if (isSet($data['volume'])) echo $data['volume']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Issue
							</label>
					</td>
					<td>
						<input type="text" class="grumble" name="issue" value="<?php if (isSet($data['issue'])) echo $data['issue']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Year
							</label>
					</td>
					<td>
						<input type="text" class="grumble" name="year" value="<?php if (isSet($data['year'])) echo $data['year']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Page_start
							</label>
					</td>
					<td>
						<input type="text" class="grumble" name="page_start" value="<?php if (isSet($data['page_start'])) echo $data['page_start']?>"><span style="color: red;">*</span>
					</td>
				
				</tr>
				<tr>
					<td>
						<label>
							Page_end
							</label>
					</td>
					<td>
						<input type="text" class="grumble" name="page_end" value="<?php if (isSet($data['page_end'])) echo $data['page_end']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Author
							</label>
					</td>
					<td>
						<input type="text" class="mini" name="author" value="<?php if (isSet($data['author'])) echo $data['author']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Topic
							</label>
					</td>
					<td>
						<?php foreach($topics as $topic):?> 
							<p><input type="checkbox" class="" name="topics" value="<?php echo $topic['id_topic']?>"><?php echo $topic['name']?></p>
						<?php endforeach;?>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Keywords
							</label>
					</td>
					<td>
						<input type="text" class="mini" name="keyword" value="<?php if (isSet($data['keyword'])) echo $data['keyword']?>">
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Content
							</label>
					</td>
					<td>
						<input type="file">
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Image
							</label>
					</td>
					<td>
						<input type="file">
					</td>
				</tr>
				<tr>
					<td style="vertical-align: top; padding-top: 9px;">
						<label>
							Abstract
							</label>
					</td>
					<td>
						<textarea class="" name="abstract" style="width: 773px; height: 144px;"><?php if (isSet($data['abstract'])) echo $data['abstract']?></textarea><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td style="vertical-align: top; padding-top: 9px;">
						<label>
						</label>
					</td>
					<td>
						<button class="btn" type="submit">Submit</button>
					</td>
				</tr>
				
			</tbody></table>
			</form>
			<a href="<?php echo Epic::getUrl('admin/journal/viewJournal',array('id_journal'=>$_GET['id_journal']));?>"> Back to journal </a>
		</div>
	</div>
</div>